package com.example.demo.util;

public class PageUtil {

    /**
     * 计算总页数
     *
     * @param totalItem
     * @param pageSize
     * @return
     */
    public static int calculateTotalPage(long totalItem, int pageSize) {
        long totalPage = totalItem / pageSize + (totalItem % pageSize == 0 ? 0 : 1);
        return (int) totalPage;
    }
}
